<template>
  <div id="selectAnalysis">
    <div class="products">
      <div class="wrapper">
        <div class="title">Products</div>
        <div class="content">
          <div class="series">
            <div class="img-wrap"
                 :class="{'active': chartShow === 'series'}">
              <img src="../../../assets/images/1.png"
                   alt=""
                   @click="selectAnalysis('series')">
            </div>
            <div class="desc">Collection</div>
          </div>
          <div class="material">
            <div class="img-wrap"
                 :class="{'active': chartShow === 'material'}">
              <img src="../../../assets/images/2.png"
                   alt=""
                   @click="selectAnalysis('material')">
            </div>
            <div class="desc">Material</div>
          </div>
          <div class="color">
            <div class="img-wrap"
                 :class="{'active': chartShow === 'color'}">
              <img src="../../../assets/images/3.png"
                   alt=""
                   @click="selectAnalysis('color')">
            </div>
            <div class="desc">Color</div>
          </div>
          <div class="classfication">
            <div class="img-wrap"
                 :class="{'active': chartShow === 'type'}">
              <img src="../../../assets/images/4.png"
                   alt=""
                   @click="selectAnalysis('type')">
              <div class="desc">Category</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div>
      <div class="wrapper">
        <div class="title">Pricing</div>
        <div class="content">
          <div class="price-index">
            <div class="img-wrap"
                 :class="{'active': chartShow === 'pricing'}">
              <img src="../../../assets/images/5.png"
                   alt=""
                   @click="selectAnalysis('priceIndex')">
            </div>
            <div class="desc">Pricing</div>
          </div>
        </div>
      </div>
    </div>
    <div>
      <div class="wrapper">
        <div class="title">New In</div>
        <div class="content last">
          <div class="new-in">
            <div class="img-wrap"
                 :class="{'active': chartShow === 'newIn'}">
              <img src="../../../assets/images/6.png"
                   alt=""
                   @click="selectAnalysis('newIn')">
            </div>
            <div class="desc">New In</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapGetters } from "vuex";

export default {
  data() {
    return {};
  },
  created() {},
  computed: {
    ...mapGetters(["chartShow"])
  },
  methods: {
    selectAnalysis(val) {
      this.$emit("changeMode", val);
    }
  },
  components: {}
};
</script>

<style lang="scss">
@import "../../../assets/styles/color.scss";
@import "../../../assets/styles/mixins.scss";

#selectAnalysis {
  position: absolute;
  width: 850px;
  left: 8.7rem;
  top: 0;
  z-index: 10000;
  background-color: $bgColor;
  text-align: left;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  .wrapper {
    height: 170px;
    margin-bottom: 3px;
    .title {
      text-indent: 12px;
      font-weight: 500;
      font-size: 18px;
      height: 30px;
      line-height: 30px;
      color: #333;
    }
    .content {
      padding-left: 12px;
      border-bottom: 1px solid $grayLine;
      &.last {
        border-bottom: none;
      }
      & > div {
        margin-right: 18px;
        display: inline-block;
        width: 180px;
        .img-wrap {
          &.active {
            img {
              border: 3px solid $base;
            }
          }
          img {
            display: block;
            height: 110px;
            width: 180px;
            background-color: #fff;
            cursor: pointer;
          }
        }
        .desc {
          line-height: 30px;
          height: 30px;
          font-size: 16px;
          color: #a1a4a5;
        }
      }
    }
  }
}
</style>
